package com.rgs.rabbitmq.controller;

import com.rgs.rabbitmq.service.RabbitMQService;
import com.rgs.rabbitmq.service.impl.RabbitMQServiceImpl;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @program: com-rgs-parent
 * @description:
 * @author: Mr.Ren
 * @create: 2023-01-06 10:49
 **/
@RestController
@RequestMapping("/rabbitmq")
public class RabbitMQController {

    @Resource
    private RabbitMQService rabbitMQService;

    @PostMapping("/sendMsg")
    public String sendMsg(@RequestParam("msg") String msg) throws Exception{
        return rabbitMQService.sendMsg(msg);
    }

    @PostMapping("/sendMsgByFanout")
    public String sendMsgByFanout(@RequestParam("msg") String msg) throws Exception{
        return rabbitMQService.sendMsgByFanout(msg);
    }
}
